/****************************************************************************
**
** Copyright (C) 2009-2010 Mist Poryvaev.
** All rights reserved.
** Contact: Mist Poryvaev (mist.poryvaev@gmail.com)
**
** This file is part of the RailWorm project.
**
****************************************************************************/

#ifndef SETUPPROXY_H
#define SETUPPROXY_H

#include <QtGui>

namespace Ui {
    class SetupProxy;
}

class SetupProxy : public QDialog {
    Q_OBJECT
public:
	~SetupProxy();
	static SetupProxy * i();
	QString Address() { return m_SavedAddress; }
	QString Port() { return m_SavedPort; }
	bool UseProxy() { return m_SavedUseProxy; }

protected:
	void showEvent(QShowEvent * se);

private:
	SetupProxy(QWidget *parent = 0);
	static SetupProxy * g_Instance;
	Ui::SetupProxy *ui;
	QString m_SavedAddress, m_SavedPort;
	bool m_SavedUseProxy;

private slots:
	void on_UseProxy_toggled(bool checked);
	void on_UseNoProxy_toggled(bool checked);
	void on_buttonBox_rejected();
	void on_buttonBox_accepted();
signals:
	void ProxyChanged(QString, QString);
};

#endif // SETUPPROXY_H
